<template>
<Modal v-model="modalEdit" fullscreen @on-cancel="handleModalEditCancel">
	<template #header>
		<Icon custom="iconfont icon-Word"/>&nbsp;立案审批表&nbsp;
	</template>
	<template #footer><Space>
		<Button shape="circle" @click="handleModalEditCancel">取消</Button>
		<Button type="primary" shape="circle" @click="handleModalEditOK">提交</Button>
	</Space></template>
	<div><Row justify="center"><Col span="16">
		<Card title="案件简要情况" icon="ios-bookmark">
			<template #extra>
				{{baseform.party_name}}&nbsp;涉嫌&nbsp;{{baseform.cause_name}}
			</template>
			<Input v-model="baseform.brief" maxlength="500" show-word-limit type="textarea" :rows="5"/>
		</Card>
		<br>
		<Card title="承办人意见" icon="ios-bookmark">
			<template #extra>
				提交日期：<DatePicker v-model="baseform.date1" type="date" placeholder="选择日期" style="width: 200px"></DatePicker>
			</template>
			<Input v-model="baseform.undertaker_opinion" maxlength="300" show-word-limit type="textarea" :rows="3"/>
		</Card>
	</Col></Row></div>
</Modal>
</template>

<script>
import {dateUtils,appendDoc} from '@/libs/tools.js'
import config from '@/config'
export default{
	data(){
		return {
			modalEdit:true,
			baseform:{}
		}
	},
	methods:{
		handleModalEditCancel(){
			this.$router.go(-1)
		},
		handleModalEditOK(){
			let data={...this.baseform}
			dateUtils.formatDates(data,"date1")
			data.docs=appendDoc(data.docs,"doc006")
			data.undertaker_name=this.$store.state.user.userInfo.uid
			this.$axios.post('mainCase1CreateDoc006.action',data).then(res=>{
				window.open(config.baseUrl+res.data,'_blank')
				this.$router.go(-1)
			})
		}
	},
	mounted(){
		this.$axios.post('mainCase1GetDoc006.action',{
			case_no:this.$route.query.case_no,
			party_type:this.$route.query.party_type
		}).then(res=>{
			this.baseform={...this.baseform,...res.data}
			dateUtils.dateNotNull(this.baseform,"date1")
		})
	}
}
</script>

<style>
</style>